<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script src='vue.js'></script>
</head>
<body>
	<div id="app">
		<component :is="show"></component>
		<!-- <child-one v-if="show === 'child-one'"></child-one>
		<child-two v-if="show === 'child-two'"></child-two> -->
		<button @click="handleBtnClick">change</button>
	</div>

	<script>

		Vue.component('child-one', {
			template: '<div v-once>chil-one</div>',
		})

		Vue.component('child-two', {
			template: '<div v-once>chil-two</div>',
		})

		var app = new Vue({
			el: '#app',
			data: {
				show: 'child-one'
			},
			methods: {
				handleBtnClick () {
					this.show === 'child-one' ? this.show = 'child-two' : this.show = 'child-one';
				}
			}
		})

		
	</script>
</body>
</html>